<template>
	<view>
		<u-tabs ref="uTab" :list="tabList" :is-scroll="false" :current="current" @change="change"></u-tabs>
		<view class="img-box" v-if="current == 0">
			<u-image :src="currPublicPath + '/static/img/hsjcIdCardCode.png'" :width="screenWidth" :height="screenHeight" mode="scaleToFill"></u-image>
		</view>
		<view class="img-box" v-if="current == 1">
			<u-image :src="currPublicPath + '/static/img/jiangsuHealthyCode.png'" :width="screenWidth" :height="screenHeight" mode="scaleToFill"></u-image>
		</view>
		<view class="img-box" v-if="current == 2">
			<u-image :src="currPublicPath + '/static/img/xingchengCard.png'" :width="screenWidth" :height="screenHeight" mode="scaleToFill"></u-image>
		</view>
	</view>
</template>

<script>
	let me;
	export default {
		data() {
			return {
				tabList: [
					{ name: "核酸码" },
					{ name: "健康码" },
					{ name: "行程卡" },
				],
				current: 0,
				screenWidth: "325px",
				screenHeight: "625px",
				currPublicPath: process.env.NODE_ENV == "production" ? "/citizen-mobile" : ""
			}
		},
		onLoad() {
			me = this;
			me.queryMyCodes();// 查询我的码
			me.$nextTick(() => {
				me.screenWidth = window.innerWidth + "px";
				me.screenHeight = window.innerHeight - 48 - me.$refs.uTab.innerHeight + "px";
			})
		},
		methods: {
			/**
			 * 切换TAB时

			 * @param {Object} e 切换的tab的下标
			 */
			change(e) {
				me.current = e;
			},
			/**
			 * 查询我的码
			 */
			queryMyCodes() {
				
			},
		}
	}
</script>

<style lang="scss" scoped>
	.img-box {
		width:100vw;
	}
</style>